#ifndef AMFREADER_H
#define AMFREADER_H

#include <wx/string.h>
#include <wx/stream.h>
//#include <vector.h>

#include "AMFMessage.h"
#include "AMFObject.h"
#include "wxAMF.h"

namespace AMF {

class AMFReader
{
    public:
        AMFReader(wxInputStream &input);
        virtual ~AMFReader();
        AMFMessage ReadAMFMessage();
    protected:
    private:
        AMFObject *ReadAMFData();
        AMFObject *ReadAMF3Data();
        AMFObject *ReadAMF3Array();
        vector<AMFObject*> *ReadAMFArray();
        Hashtable *ReadAMF3Object();
        void TryClassDefinition(wxInt32 handle);
        wxString *ReadAMF3String();
        wxInt32 ReadAMF3IntegerData();
        wxUint16 ReadUInt16();
        wxUint32 ReadUInt32();
        wxDouble ReadDouble();
        vector<wxByte> ReadIntegerBytes(int s);
        wxString ReadString();
        wxArrayString _stringReference;
        wxInputStream *_input;
};

} // namespace AMF

#endif // AMFREADER_H
